home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / Report Writers / Crystal Repot 9.0 Full CD version / Setup.exe / Windows / System32 / HTMLRE90.DLL / HTML / 11813 < prev    next >
Encoding:
Text File  |  2002-07-05  |  8.1 KB  |  330 lines

  1. <HTML>
  2. <HEAD>
  3. <LINK REL="stylesheet" TYPE="text/css" HREF="%1css/default.css">
  4.  
  5. <script language="JavaScript" src="%1js/FormChek.js"></script>
  6.  
  7. <script>
  8. // *************LOCALIZATION STRINGS*************
  9. var L_PRINTER_NAME_EMPTY = "The printer name/command cannot be empty.";
  10. var L_NOT_A_NUMBER_OR_ZERO = "The value must be a whole number greater than zero.";
  11. var L_TO_LESS_THAN_FROM = "The From page number must be equal or less than the To page number."
  12. </script>
  13.  
  14. <SCRIPT>
  15. var oldLayout = "%11";
  16. var canDisableNames = true;
  17.  
  18. function Init()
  19. {
  20.     document.layoutform.layout.value = "%11";
  21.  
  22.     // remap default printer to specific printer
  23.     if ( oldLayout == "1" )
  24.         oldLayout = "3";
  25.  
  26.     // remap no printer to custom
  27.     if ( oldLayout == "2" )
  28.         oldLayout = "4";
  29.  
  30.     // allow name selection to be enabled.
  31.     if ( oldLayout == "3" )
  32.         canDisableNames = false;
  33.  
  34.     var i;
  35.     for ( i = 0; i < document.layoutform.layoutsel.length; i++)
  36.     {
  37.         if ( document.layoutform.layoutsel.options[i].value == oldLayout )
  38.         {
  39.             document.layoutform.layoutsel.selectedIndex = i;
  40.             break;
  41.         }
  42.     }
  43.  
  44.     if ( oldLayout == "3" || oldLayout == "4" )
  45.         InitExtra();
  46.  
  47.     // init printing
  48.     OnEnablePrinter();
  49. }
  50.  
  51. function OnChangeLayout(d)
  52. {
  53.     if ( !CheckPrintWhenScheduling() )
  54.         return;
  55.  
  56.     document.layoutform.layout.value = document.layoutform.layoutsel.value;
  57.     document.layoutform.action = "%2";
  58.     document.layoutform.submit();
  59. }
  60.  
  61. function OnSetPrinterNameDisabled()
  62. {
  63.     document.layoutform.printername.disabled = document.layoutform.usedefaultprinter[0].checked;
  64. }
  65.  
  66. function OnEnablePrinter()
  67. {
  68.     var isDisabled = !document.layoutform.enableprinterchk.checked;
  69.  
  70.     if ( canDisableNames )
  71.     {
  72.         document.layoutform.usedefaultprinter[0].disabled = isDisabled;
  73.         document.layoutform.usedefaultprinter[1].disabled = isDisabled;
  74.  
  75.         if ( isDisabled )
  76.             document.layoutform.printername.disabled = isDisabled;
  77.         else
  78.             OnSetPrinterNameDisabled();
  79.     }
  80.  
  81.     document.layoutform.copies.disabled = isDisabled;
  82.     document.layoutform.pages[0].disabled = isDisabled;
  83.     document.layoutform.pages[1].disabled = isDisabled;
  84.  
  85.     OnSetPageRange();
  86. }
  87.  
  88. function OnSetPageRange()
  89. {
  90.     var isDisabled = ( document.layoutform.pages[0].checked || !document.layoutform.enableprinterchk.checked);
  91.  
  92.     document.layoutform.from.disabled = isDisabled;
  93.     document.layoutform.to.disabled = isDisabled;
  94. }
  95.  
  96. function CheckPrintWhenScheduling()
  97. {
  98.     // enable printing
  99.     if ( document.layoutform.enableprinterchk.checked )
  100.         document.layoutform.enableprinter.value = "true";
  101.     else
  102.         document.layoutform.enableprinter.value = "false";
  103.  
  104.     if ( document.layoutform.enableprinterchk.checked )
  105.     {
  106.         // check empty printer name
  107.         if ( ( oldLayout != "3") && ( document.layoutform.usedefaultprinter[1].checked ) )
  108.         {
  109.             if ( document.layoutform.printername.value == "" )
  110.             {
  111.                 alert( L_PRINTER_NAME_EMPTY );
  112.  
  113.                 document.layoutform.printername.focus();
  114.                 document.layoutform.printername.select();
  115.  
  116.                 return false;
  117.             }
  118.         }
  119.  
  120.         var testNum1;
  121.         var testNum2;
  122.  
  123.         // check number of copies
  124.         testNum1 = document.layoutform.copies.value;
  125.  
  126.         if ( !isPositiveInteger(testNum1) )
  127.         {
  128.             alert( L_NOT_A_NUMBER_OR_ZERO );
  129.             document.layoutform.copies.focus();
  130.             document.layoutform.copies.select();
  131.  
  132.             return false;
  133.         }
  134.  
  135.         // check range
  136.         if ( document.layoutform.pages[1].checked )
  137.         {
  138.             testNum1 = document.layoutform.from.value;
  139.             testNum2 = document.layoutform.to.value;
  140.  
  141.             // from not a valid number
  142.             if ( !isPositiveInteger(testNum1) )
  143.             {
  144.                 alert( L_NOT_A_NUMBER_OR_ZERO );
  145.                 document.layoutform.from.focus();
  146.                 document.layoutform.from.select();
  147.  
  148.                 return false;
  149.             }
  150.  
  151.             // to not a valid number
  152.             if ( !isPositiveInteger(testNum2) )
  153.             {
  154.                 alert( L_NOT_A_NUMBER_OR_ZERO );
  155.                 document.layoutform.to.focus();
  156.                 document.layoutform.to.select();
  157.  
  158.                 return false;
  159.             }
  160.  
  161.             testNum1 = Number(testNum1);
  162.             testNum2 = Number(testNum2);
  163.  
  164.             // to less than from
  165.             if ( testNum2 < testNum1 )
  166.             {
  167.                 alert( L_TO_LESS_THAN_FROM );
  168.                 document.layoutform.from.focus();
  169.                 document.layoutform.from.select();
  170.  
  171.                 return false;
  172.             }
  173.         }
  174.     }
  175.  
  176.     return true;
  177. }
  178.  
  179. function SubmitForm()
  180. {
  181.     var layoutVal = document.layoutform.layoutsel.options[document.layoutform.layoutsel.selectedIndex].value;
  182.  
  183.     document.layoutform.layout.value = layoutVal;
  184.  
  185.     // if specific printer, validate
  186.     if ( oldLayout == "3" )
  187.         if ( !CheckSpecifiedPrinter() )
  188.             return;
  189.  
  190.     // if custom, validate.
  191.     if ( oldLayout == "4" )
  192.         if ( !CheckCustom() )
  193.             return;
  194.  
  195.     // validate printing
  196.     if ( !CheckPrintWhenScheduling() )
  197.         return;
  198.  
  199.     document.layoutform.submit();
  200. }
  201.  
  202. function ResetForm()
  203. {
  204.     document.location.replace("%2");
  205. }
  206. </SCRIPT>
  207.  
  208. </HEAD>
  209. <BODY LEFTMARGIN="5" RIGHTMARGIN="5" onload='Init()'>
  210.  
  211. <DIV ID="tooltip" STYLE="position:absolute;visibility:hidden;z-index:99;"></DIV>
  212. <SCRIPT SRC="%1js/helps.js"></SCRIPT>
  213. <SCRIPT SRC="%1js/tips.js"></SCRIPT>
  214.  
  215. <form name="layoutform" method=POST action="%3" onsubmit="return false;">
  216. <span class='listSelected'>Print when scheduling</span><br>
  217. When page layout is set to "Specified printer settings", printing can only be done on the same printer set in page layout.<br>
  218. <table><tr><td><!--spacer--></td></tr></table>
  219. <center>
  220. <table width='90%' border=0>
  221. <tr>
  222.     <td class='list'>
  223.         <table border=0 cellspacing=5 cellpadding=0>
  224.         <tr>
  225.             <td class='list' valign='middle'>
  226.                 <input type="checkbox" name="enableprinterchk" %5 onClick="JavaScript:OnEnablePrinter();">
  227.                 <input type="hidden" name="enableprinter">
  228.             </td>
  229.             <td class='list'>
  230.                 Print in Crystal Reports format using the selected printer when scheduling.
  231.             </td>
  232.         </tr>
  233. %4
  234.         <tr>
  235.             <td class='list'>
  236.                  
  237.             </td>
  238.             <td calss='list'>
  239.                 <table border=0 cellpadding=4 cellspacing=0>
  240.                 <tr>
  241.                     <td class="list" valign="top" nowrap>
  242.                         <table border=0 cellpadding=0 cellspacing=0>
  243.                         <tr>
  244.                             <td class='list'>
  245.                                 Number of Copies: 
  246.                             </td>
  247.                             <td class='list'>
  248.                                 <input type='text' size='3' name='copies' value='%6'>
  249.                             </td>
  250.                             <td class="list">
  251.                                      
  252.                             </td>
  253.                             <td class='list'>
  254.                                 Page Range: 
  255.                             </td>
  256.                             <td class='list'>
  257.                                 <input type='radio' name='pages' value='all' %7 onClick="JavaScript:OnSetPageRange();">
  258.                                 All
  259.                             </td>
  260.                         </tr>
  261.                         <tr>
  262.                             <td class="list" colspan=4>
  263.                                  
  264.                             </td>
  265.                             <td class='list'>
  266.                                 <input type='radio' name='pages' value='range' nowrap %8 onClick="JavaScript:OnSetPageRange();">
  267.                                 Pages      from: <input type='text' size='3' name='from' value='%9' align=middle> to: <input type='text' size='3' name='to' value='%10' align=middle>
  268.                             </td>
  269.                         </tr>
  270.                         </table>
  271.                     </td>
  272.                 </tr>
  273.                 </table>
  274.             </td>
  275.         </tr>
  276.         </table>
  277.     </td>
  278. </tr>
  279. </table>
  280. </center>
  281.  
  282. <p>
  283.  
  284. <span class='listSelected'>Set the report's page layout.</span><br>
  285. The page layout will be applied to all formats.
  286. <p>
  287.  
  288. <center>
  289. <table width='90%' border=0>
  290. <tr>
  291.     <td class='list'>
  292.         <table border=0 cellpadding=5 cellspacing=0>
  293.         <tr>
  294.             <td class='list'>
  295.                 Set layout to:
  296.             </td>
  297.             <td class='list'>
  298.                 <select name='layoutsel' class='menuFormElement' onchange='OnChangeLayout(this.options[this.selectedIndex].value);'>
  299.                 <option value='0' selected>Report file default
  300.                 <option value='3'>Specified printer settings
  301.                 <option value='4'>Custom settings
  302.                 </select>
  303.                 <input type=hidden name="layout">
  304.             </td>
  305.         </tr>
  306. %12
  307.         </table>
  308.     </td>
  309. </tr>
  310. </table>
  311.  
  312. <p>
  313.  
  314. </form>
  315. </center>
  316.  
  317. <table align="right" border=0 cellpadding=0>
  318. <tr valign=center>
  319.     <td class="clsButton" align=middle nowrap>
  320.         <div class="clsButton"><a href="javascript: SubmitForm()" onMouseOver="St(7);window.status='';return true;" onMouseOut="Ht()">Update</a></div>
  321.     </td>
  322.     <td class="clsButton" align=middle nowrap>
  323.         <div class="clsButton"><a href="javascript: ResetForm()" onMouseOver="St(8);window.status='';return true;" onMouseOut="Ht()">Reset</a></div>
  324.     </td>
  325. </tr>  
  326. </table>
  327.  
  328. </BODY>
  329. </HTML>
  330.